<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2020/6/20
 * Time: 15:06
 */
namespace  App\Models\Forms;

use App\Helper;
use App\Models\Group;
use App\Models\IReadable;
use Encore\Admin\Widgets\Form;

/**
 * Class TbSpiderConfig
 * @package App\Models\Forms
*/
class JdSpiderConfigV2 extends Form implements IReadable
{

    public $title = "京东";


    public function attributeLabels()
    {
        return [
            'type' => [
                'type' => 'select',
                'label' => '采集分类',
                'options' => JdDefiner::CATEGORIES,
                'required' => true
            ],
            'send_type' => [
                'type' => 'radio',
                'label' => '发送类型',
                'options' => JdDefiner::SEND_TYPE,
                'required' => true
            ],
         /*   'send_group' => [
                'label' => '发送群组',
                'type' => 'select',
                'options' => Group::getByUid(),
            ],*/
           /* 'yx' => [
                'label' => '营销活动',
                'type' => 'checkbox',
                'options' => TaobaoDefiner::YX,
                'required' => false
            ],*/
           /* 'isCoupon' => [
                'label' => '优惠券',
                'type' => 'radio',
                'options' => [
                    '无优惠券',
                    '有优惠券'
                ],
                'value' => 0,
                'visible' => true
            ],*/
            'rank' => [
                'label' => '排序方式',
                'type' => 'radio',
                'options' => JdDefiner::SORT_TYPE,
                'required' => true,
                'value' => "brokerage"
            ],
          /*  'commissionShareStart' => [
                'label' => '最低佣金比例(%)',
                'type' => 'rate',
                'required' => true,
                'value' =>  0
            ],*/
            'page' => [
                'label' => '采集页数',
                'type' => 'integer',
                'place_holder' => "每页50条数据",
                'value' => 1
            ],
           /* 'so' => [
                'type' => 'text',
                'label' => '关键词',
                'place_holder' => "请输入采集关键词，如 袜子"
            ]*/
        ];
    }

    public function form() {
        Helper::loadForm($this);
    }

    public function getAttribute($field)
    {
        // TODO: Implement getAttribute() method.
    }

}
